//
//  BasesTableViewCell.m
//  Lottery
//
//  Created by 桑赐相 on 2018/7/14.
//  Copyright © 2018年 桑赐相. All rights reserved.
//

#import "BasesTableViewCell.h"
#import "EdgeUILabel.h"
#import "TableViewModel.h"
@interface BasesTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet EdgeUILabel *badgeLabel;

@end
@implementation BasesTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.badgeLabel.text = @"0";
    self.badgeLabel.edgeInsets = UIEdgeInsetsMake(2, 10, 2, 10);
    [self.badgeLabel setLayerWithRadius:8 color:ClearColor width:0.0];
}

-(void)setModel:(TableViewModel *)model{
    _model = model;
    self.badgeLabel.hidden = YES;
    if (model.badge) {
        self.badgeLabel.hidden = NO;
        self.badgeLabel.text = model.badge;
    }
    self.iconImage.image = [UIImage imageNamed:model.icon];
    self.nameLabel.text = model.name;
}


@end


